package com.whz.enumdemo;

/**
 * @Author: sinosoft
 * @Description: 永远不要根据枚举的序数导出与它关联的值 而是要将它保存在一个实例域中
 * @Date: Create in 21:02 2021/5/13
 * @Modified By:
 */
public enum Ensemble {
    SOLO(1), DUET(2), TRIO(3), QUARTET(4);
    private final int numberOfMusicians;

    Ensemble(int size) {
        this.numberOfMusicians = size;
    }

    public int getNumberOfMusicians() {
        return numberOfMusicians;
    }
}
